package cn.wolfcode.cms.mapper;

import cn.wolfcode.cms.domain.Role;
import cn.wolfcode.cms.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    List<Role> queryForList(QueryObject qo);

    int queryForCount(QueryObject qo);


    //维护与权限关系
    void insertRelation(@Param("roleId") Long roleId,
                        @Param("permissionId") Long permissionId);

    //打破与权限关系
    void deleteRelation(Long id);

    List<Long> getRoleIdsByEmployeeId(Long id);

    List<String> getRoleSnByEmpId(Long id);
}